
#         ___    __                                            ___
#        /\_ \  /\ \__                                       /'___\ __
#  __  __\//\ \ \ \ ,_\  _ __    __      ___    ___     ___ /\ \__//\_\     __
# /\ \/\ \ \ \ \ \ \ \/ /\`'__\/'__`\   /'___\ / __`\ /' _ `\ \ ,__\/\ \  /'_ `\
# \ \ \_\ \ \_\ \_\ \ \_\ \ \//\ \L\.\_/\ \__//\ \L\ \/\ \/\ \ \ \_/\ \ \/\ \L\ \
#  \ \____/ /\____\\ \__\\ \_\\ \__/.\_\ \____\ \____/\ \_\ \_\ \_\  \ \_\ \____ \
#   \/___/  \/____/ \/__/ \/_/ \/__/\/_/\/____/\/___/  \/_/\/_/\/_/   \/_/\/___L\ \
#                                                                          /\____/
#                                                                          \_/__/
exec_always "setxkbmap -model pc104 -layout us,ru -variant ,, -option grp:alt_shift_toggle"
# the MOD key(windows)
set $mod Mod4
exec --no-startup-id dex --autostart --environment i3
exec --no-startup-id sh ~/.config/polybar/launch.sh
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock-fancy --nofork
exec --no-startup-id nm-applet
for_window [class="^.*"] border pixel 2
gaps inner 10
gaps outer 10

bindsym $mod+z		gaps outer current plus  5 
bindsym $mod+Shift+z	gaps outer current minus 5

# sets the wallpaper
exec --no-startup-id feh --bg-fill ~/.config/i3/wallpapers/gruv-houses.png
# starts the compositor
exec --no-startup-id picom --config ~/.config/picom/picom.conf 
# Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status

# removes the titlebar
for_window [class="^.*"] border pixel 0
for_window [class="krunner"] border pixel 0
for_window [class="krunner"] floating enable

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

# start a terminal
bindsym $mod+Return exec alacritty

bindsym $mod+Shift+f exec librewolf

bindsym $mod+c exec codium

# start the launcher
bindsym $mod+d exec rofi -show drun

# kill focused window
bindsym $mod+Shift+q kill

# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right

bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right

bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

# split in horizontal orientation
bindsym $mod+Ctrl+h split h

# split in vertical orientation
bindsym $mod+Ctrl+v split v

# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle

# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split

# toggle tiling / floating
bindsym $mod+Shift+space floating toggle

# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle

# focus the parent container
bindsym $mod+a focus parent

# font in use by i3
font pango:JetbrainsMono Nerd Font 11

# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"

# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10

# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10

assign [class="LibreWolf"] $ws3
assign [class="Codium"] $ws2

# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'do you want to quit i3 (◕‿◕ ✿) ?' -B 'YEAH FUCK THIS SHIT' 'i3-msg exit'"

# resize window (you can also use the mouse for that)
mode "resize" {
        bindsym h resize shrink width 10 px or 10 ppt
        bindsym k resize grow height 10 px or 10 ppt
        bindsym j resize shrink height 10 px or 10 ppt
        bindsym l resize grow width 10 px or 10 ppt

        # back to normal: Enter or Escape or $mod+r
        bindsym Return mode "default"
        bindsym Escape mode "default"
        bindsym $mod+r mode "default"
}
# class                 border  backgr. text    indicator child_border
client.focused          #282828 #282828 #83a598  #83a598   #458588
client.focused_inactive #282828 #282828 #ebdbb2  #d3869b   #5f676a
client.unfocused        #1d2021 #282828 #ebdbb2  #282828   #1d2021
client.urgent           #cc241c #928364 #ebdbb2  #cc241c   #cc241c
client.placeholder      #8ec07c #0c0c0c #ebdbb2  #ebdbb2   #1d2021  

client.background      #fbf1c7 

bindsym $mod+r mode "resize"


bindsym XF86MonBrightnessUp exec "xbacklight -inc 5"
bindsym XF86MonBrightnessDown exec "xbacklight -dec 5"

bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5%
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5%
bindsym XF86AudioMute exec amixer -q set Master toggle


bindsym Print exec flameshot full
#-p ~/Pictures/screenshots/screen-"$(date +%s)".png
bindsym $mod+Print exec flameshot gui 
#-p ~/Pictures/screenshots/screen-"$(date +%s)".png
